﻿
/// <reference path="../jquery-1.6.2-vsdoc.js" />

(function ($) {

    $.fn.recaptcha = function (o) {

        var defaults = {
            publicKey: '6LfV3MISAAAAAMfrkyDzhYZNkjR3YlyOC_YlIfn_',
            theme: 'red',
            callback: function () { }
        };

        if (!Recaptcha) return false;

        return this.each(function () {

            var m = $(this);

            var s = $.extend({}, defaults, o || {}, $.metadata ? m.metadata() : $.meta ? m.data() : {});

            var id = m.attr('id');
            if (id === undefined) {
                id = 'recapcha_' + new Date().getTime();
                m.attr('id', id);
            }

            Recaptcha.create(s.publicKey, id, {
                theme: s.theme,
                callback: s.callback
            });

        });
    };

})(jQuery);